<!DOCTYPE html>
<html  xmlns="http://www.w3.org/1999/xhtml"
       xmlns:th="http://www.thymeleaf.org"
       xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
       layout:decorator="layout">
<head></head>
<body>
<div class='pager-page'>
    <span th:if="${page.pageIndex &gt; 2}" class='pager-dleft' action-type="page" data-value="1"></span>
    <span th:if="${page.pageIndex &gt; 1}" class='pager-left' action-type="page" th:attr="data-value=${page.pageIndex-1}"></span>
    <span th:if="${(page.pageIndex - page.limit) &gt; 1}">...</span>
        <span th:each="item : ${#numbers.sequence(page.start, page.end)}" action-type="page"
              th:text="((${page.getPageCount() eq 1}) ? '' : ${item})" th:attr="data-value=((${page.getPageCount() eq 1}) ? '' : ${item})"></span>
    <span th:if="${(page.pageIndex + page.limit) &lt; page.pageCount}">...</span>
    <span th:if="${page.pageIndex &lt; page.pageCount}" class='pager-right' action-type="page" th:attr="data-value=${page.pageIndex+1}"></span>
    <span th:if="${page.pageIndex &lt; page.pageCount-1}" class='pager-dright' action-type="page" th:attr="data-value=${page.pageCount}"></span>
</div>
</body>
</html>

